<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>院校详情</title>
    <script type="text/javascript"  src="http://code.jquery.com/jquery-1.8.3.js"></script>
  <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.3/themes/smoothness/jquery-ui.css" />
  <script type="text/javascript"  src="http://code.jquery.com/ui/1.10.3/jquery-ui.js"></script>
  <link rel="stylesheet" href="index.css">
  <link rel="stylesheet" href="main.css">
  <link rel="stylesheet" href="item.css">
  <link rel="stylesheet" href="shoolitem.css">
  <link rel="stylesheet" href="./swiper/dist/css/swiper.css">
  <script type="text/javascript" src="./static/store.legacy.min.js"></script>
  <script src="./static/util.js"></script>
</head>
<body>

  <header>
    <div class="headerSwipper">
      <div class="headerSwipper_div">
        <div class="headerSwipper_div_iconview">
          <img src="./static/images/logo.png" alt="">
        </div>
        <div class="headerSwipper_div_myicon">
          <!-- <img src="" alt=""> -->
          <span class="loginText">登录</span>
          <div class="headerSwipper_div_myicon_icon" style="display: none">
            <img src="./static/images/iconsmall.png" alt="">
          </div>
          <div class="headerSwipper_div_myicon_info">
            <ul>
              <li class="headerSwipper_div_myicon_info_li">消息</li>
              <li class="headerSwipper_div_myicon_info_li">退出</li>
            </ul>
          </div>
        </div>
        <ul class="headerSwipper_div_ul">
          <li class="headerSwipper_div_li mobileapp">手机APP</li>
          <li class="headerSwipper_div_li vipprop">开通VIP</li>
        </ul>
      </div>
    </div>
  </header>
  <section>
      <div class="ImgSwipperview">
          <!-- <img class="_img" src="./static/images/mainSwipper.png" alt=""> -->
          <div class="swiper-container">
            <div class="swiper-wrapper">
            </div>
            <!-- Add Arrows -->
            <div class="swiper-button-next"></div>
        <div class="swiper-button-prev"></div>
        <div class="swiper-pagination"></div>
            <div class="swiper-button-prev"></div>
          </div>
        </div>
  </section>
  <section>
    <div class="mainContentView">
      <div class="contentView">
        <!-- 上侧导航 -->
        <div class="topnav">
          <ul class="contentView_ul">
            <li class="contentView_li contentView_li_active">首页</li>
            <li class="contentView_li">学习中心</li>
            <li class="contentView_li">志愿填报</li>
            <li class="contentView_li">微课</li>
            <li class="contentView_li">模拟试题</li>
            <li class="contentView_li">往届真题</li>
            <li class="contentView_li">咨询</li>
          </ul>
          <div class="inputview">
            <input class="inputview_input" id="tag" 
 type="text" placeholder="搜索院校">
            <img  class="searchicon_img" src="./static/images/searchicon.png" alt="">
          </div>
        </div>
      </div>
    </div>
  </section>
  <section>
    <div class="itemViewSiwpper">
      <div class="itemView">
        <p class="shool_name"></p>
          <p class="segmentation moreSmallClass">
            <span class="segmentation_title">院校简介</span>
          </p>
        <p class="shool_synopsis"></p>
          <p class="segmentation moreSmallClass">
            <span class="segmentation_title">特色专业</span>
          </p>
        <p class="shool_feature"></p>
        <p class="subscribe">自荐信</p>
      </div>
    </div>
  </section>
  <footer>
    <div class="footerSwipper">
      <div class="footerSwipper_div">
        <ul class="footerSwipper_div_ul">
          <span class="footerSwipper_div_ul_span"><a href="./index.html">首页</a></span>
          <li class="footerSwipper_div_ul_li"><a href="./schools.html?keyword=">院校大全</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./major.html">专业大全</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./mentality.html">心理辅导</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./careerPlanning.html">职业规划</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./infoTest.html">高考资讯</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./recruitment.html?type=1">自主招生</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./recruitment.html?type=2">单独招生</a></li>
        </ul>
        <ul class="footerSwipper_div_ul">
          <span class="footerSwipper_div_ul_span">学习提升</span>
          <li class="footerSwipper_div_ul_li"><a href="./index.html?index=3">微课</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./index.html?index=4">模拟试题</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./index.html?index=5">往届试题</a></li>
        </ul>
        <ul class="footerSwipper_div_ul">
          <span class="footerSwipper_div_ul_span">志愿填报</span>
          <li class="footerSwipper_div_ul_li"><a href="./index.html?index=6">咨询</a></li>
          <li class="footerSwipper_div_ul_li"><a href="./mobileapp.html">下载APP</a></li>
        </ul>
        <!-- 扫一扫关注我们区域 -->
        <div class="QRcodeSwipper">
          <span class="QRcodeSwipper_span">扫一扫关注我们</span>
          <div class="QRcodeSwipper_imgview">
            <img src="./static/images/qr.png" alt="">
          </div>
        </div>
        <!-- 中间信息区域 -->
        <div class="middleInfo">
          <span class="middleInfo_span_city">中国·河南·郑州</span>
          <span class="middleInfo_span_GE"><span class="middleInfo_span_GE_icon middleInfo_span_GE_icon_special phone_icon"><img src="./static/images/phone.png" alt=""></span><span class="middleInfo_span_GE_text middleInfo_span_GE_text_color">0371-68064945</span></span>
          <span class="middleInfo_span_GE"><span class="middleInfo_span_GE_icon message_icon"><img src="./static/images/message.png" alt=""></span><span class="middleInfo_span_GE_text">595879735@qq.com</span></span>
          <span class="middleInfo_span_GE"><span class="middleInfo_span_GE_icon message_icon"><img src="./static/images/store.png" alt=""></span><span class="middleInfo_span_GE_text">河南柒佰伴教育信息咨询有限公司
          </span></span>
          <span class="middleInfo_span_GE"><span class="middleInfo_span_GE_icon middleInfo_span_GE_icon_special address_icon"><img src="./static/images/address.png" alt=""></span><span class="middleInfo_span_GE_text middleInfo_span_GE_text_special">郑州市郑东新区立体世界
            </span></span>
        </div>
        <p class="footerSwipper_div_p">河南世霖网络软件科技 2014-2018 豫ICP备14010456号-1</p>
      </div>
    </div>
  </footer>
  <script src="./static/util.js"></script>
  <script src="./swiper/dist/js/swiper.js"></script>
  <script>
    var swiper = new Swiper('.swiper-container', {
      navigation: {
        nextEl: '.swiper-button-next',
        prevEl: '.swiper-button-prev',
      },
      pagination: {
        el: '.swiper-pagination',
      },
      observer:true,//修改swiper自己或子元素时，自动初始化swiper
      observeParents:true//修改swiper的父元素时，自动初始化swiper
    });
  </script>
  <script>
    $(document).ready(function(){
      ArrowNavigation($('.itemView'), ['main','recruitment'])
      // 加载ajax来的数据 从url上获取类型 以及id
      var schoolid =  getparse(location.href, 2)
      var type_nav = getparse(location.href, 1)
      var id = getparse(location.href, 0)
      var info_id = ''
      function init () {
        $.post({
          url: urlhost + '/admin.php/api/homepage/zyx_detail',
          method: 'POST',
          data: {zs_id: schoolid,
          uid: store.get('uid')},
          success: function (res) {
            // console.log(res.data)
            info_id = res.data.info_id
            $.post({
              url: urlhost + '/admin.php/api/homepage/get_yuy',
              method: 'POST',
              data: {
                uid: store.get('uid'),
                info_id: res.data.info_id,
                type: type_nav
              },
              success: function (res1) {
                var listinfo = ['处理中','已处理']
                if(res1.code == 0) {
                  $('.subscribe').text(listinfo[res1.data.status])

                }
              }
            })
          }
        })
        $.post({
          url: urlhost + '/admin.php/api/homepage/school_detail',
          method: 'POST',
          data: {school_id: id},
          success: function (res) {
            // console.log(res.data)
            var schoolinfo = res.data
            $('.shool_name').text(schoolinfo.sch_name)
            $('.shool_synopsis').html(schoolinfo.sch_desc)
            $('.shool_feature').html(schoolinfo.sch_zy)
          }
        })
      }
      init()
      // li标签点击 需要跳转页面 同时传递第几个 进行初始化
      $('.contentView_li').click(
        function() {
          var index = $(this).index()
          window.location.href = './index.html?index=' + index
        }
      )
      // 遮罩层显示隐藏事件
      $('body').on('click', '.closeQu', function() {
        $(this).parents('.OnlineQuestion').remove()
      })
      $('body').on('click', '.OnlineQuestion', function(e) {
        if(e.target.className == 'OnlineQuestion'){
          $(this).remove()
        }
      })
      $('.itemViewSiwpper').on('click', '.subscribe', function() {
        $.post({
          url: urlhost + '/admin.php/api/homepage/get_yuy',
          method: 'POST',
          data: {
            uid: store.get('uid'),
            info_id: info_id,
            type: type_nav
          },
          success: function (res1) {
            var listinfo = ['处理中','已处理']
            if(res1.code == 0) {
              $('body').prepend('<div class="OnlineQuestion">'
                  + '<form id="formdata" method="post">'
              + '<div class="questionTextView">'
                + '<div class="inputposition">'
                  + '<label for="questionTextView_input">姓名</label>'
                  + '<input type="text" name="name" class="questionTextView_input" placeholder="请输入您的姓名" value="' + res1.data.name + '">'
                + '</div>'
                + '<div class="inputposition">'
                  + '<label for="questionTextView_input">电话</label>'
                  + '<input type="text" name="phone" id="phone" class="questionTextView_input questionTextView_input_phone" placeholder="请输入您的电话" required="required" maxlength="11"  value="' + res1.data.phone + '">'
                + '</div>'
                + '<div class="inputposition height_text">'
                    + '<span class="desctext">自我描述</span>'
                  + '<textarea id="textarea" name="desc" class="questionTextView_input" placeholder="请输入自我描述内容"  value="' + res1.data.desc + '"></textarea>'
                + '</div>'
                + '<p class="submit">提交</p>'
                + '<img class="closeQu" src="./static/images/close.png" alt="">'
              + '</div>'
              + '</form>'
            + '</div>')

            }else {
                $('body').prepend('<div class="OnlineQuestion">'
                  + '<form id="formdata" method="post">'
              + '<div class="questionTextView">'
                + '<div class="inputposition">'
                  + '<label for="questionTextView_input">姓名</label>'
                  + '<input type="text" name="name" class="questionTextView_input" placeholder="请输入您的姓名">'
                + '</div>'
                + '<div class="inputposition">'
                  + '<label for="questionTextView_input">电话</label>'
                  + '<input type="text" name="phone" id="phone" class="questionTextView_input questionTextView_input_phone" placeholder="请输入您的电话" required="required" maxlength="11">'
                + '</div>'
                + '<div class="inputposition height_text">'
                    + '<span class="desctext">自我描述</span>'
                  + '<textarea id="textarea" name="desc" class="questionTextView_input" placeholder="请输入自我描述内容"></textarea>'
                + '</div>'
                + '<p class="submit">提交</p>'
                + '<img class="closeQu" src="./static/images/close.png" alt="">'
              + '</div>'
              + '</form>'
            + '</div>')

            }
          }
      })
      })
      $('body').on('click', '.submit', function () {
        
      var formdata = $("#formdata").serializeArray()
      formdata.push({
        name: 'uid',
        value: store.get('uid')
      })
      formdata.push({
        name: 'type',
        value: type_nav
      })
      formdata.push({
        name: 'school_id',
        value: id
      })
      if(formdata[1].value.length != 11) {
        widowAle("手机号有误")
        return
      }else {
        $.post({
          url: urlhost + '/admin.php/api/homepage/yuy',
          method: 'post',
          data: formdata,
          success: function (res) {
            $('.OnlineQuestion').empty()
            $('.OnlineQuestion').prepend(
              '<div class="comfireview_div">'
              + res.msg
              + '</div>')
              setTimeout(() => {
                $('.OnlineQuestion').remove()
              },2000)
          }
        })

      }
      })
      function clearNoNumber(_this){
        var result = $(_this).val().replace(/\D/g,'');
        $(_this).val(result);
      }
      $('body').on('focus','.questionTextView_input_phone',function() {
        // console.log('focus')
        clearNoNumber(this);
      })
      $('body').on('keyup','#phone',function() {
        clearNoNumber(this);
      })
      $('body').on('blur','#phone',function() {
        clearNoNumber(this);
      })

      // 轮播图获取
      $.ajax({
        url: urlhost + '/admin.php/api/homepage/pc_banner',
        method: 'POST',
        data: {
          type: 1
        },
        success: function(res) {
          // <div class="swiper-slide">
          //   <img class="_img" src="./static/images/mainSwipper.png" alt="">
          // </div>
          $('.swiper-wrapper').empty()
          var html = ''
          for(var i=0;i<res.data.length;i++) {
            html += '<div class="swiper-slide">'
              + '<img class="ImgSwipperview_img" src="' + res.data[i].pic + '" alt="">'
            + '</div>'
          }
          $('.swiper-wrapper').html(html)
        }
      })
  })
  </script>
  </body>
</html>
